using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using Eureka.modelos;

namespace WebApplication1
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
        void Session_End(object sender, EventArgs E)
        {
            // inserindo no log
            Log log = new Log((int)Session["id"], "Logoff por Timeout", 0);
            log.criar();

            // setando a flag
            Administrador admin = new Administrador((int)Session["id"]);
            admin.deslogar();

            Response.Clear();
            Session.Clear();
            FormsAuthentication.SignOut();

        }
    }
}